﻿namespace Liger.Web.UI
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Liger.Web.Common;
    using Liger.Web.Common.Extensions;

    public class GridColumnsBuilder : IHideObjectMembers
    {
        private readonly IList<GridColumn> columns;
        public GridColumnsBuilder(IList<GridColumn> columns)
        {
            this.columns = columns;
        }

        public virtual GridColumnBuilder Add(string name)
        {
            return Bound(name);
        }

        public virtual GridColumnBuilder Bound(string name)
        {
            GridColumn column = new GridColumn();
            column.Name = name;
            this.columns.Add(column);
            return new GridColumnBuilder(column);
        }

    }
}
